package com.service;

import com.entity.*;
import com.mapper.DepartmentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentService {

    @Autowired
    private DepartmentMapper departmentMapper;

    public List<Department> findAll(){
        return departmentMapper.findAll();
    }

    public int addDepartment(Department department){
        return departmentMapper.addDepartment(department);
    }

    public int deleteDepartment(String dpnum){
        return departmentMapper.deleteDepartment(dpnum);
    }

    public int editDepartment(Department department){
        return departmentMapper.editDepartment(department);
    }

    public Department upDepartment(String dpnum){
        return departmentMapper.upDepartment(dpnum);
    }

}
